package com.domain.dto;

import com.domain.entity.TokenEntity;
import com.domain.entity.UserEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;
import java.util.List;

@Getter
@Setter
public class CanalBean<T> implements Serializable {

    //数据
    private List<T> data;
    //数据库名称
    private String database;
    private long es;
    //递增，从1开始
    private int id;
    //是否是DDL语句
    private boolean isDdl;
    //表结构的字段类型
    private MysqlType mysqlType;
    //UPDATE语句，旧数据
    private String old;
    //主键名称
    private List<String> pkNames;
    //sql语句
    private String sql;
    private SqlType sqlType;
    //表名
    private String table;
    private long ts;
    //(新增)INSERT、(更新)UPDATE、(删除)DELETE、(删除表)ERASE等等
    private String type;

    public CanalBean() {
    }

    public CanalBean(List<T> data, String database, long es, int id, boolean isDdl, MysqlType mysqlType, String old, List<String> pkNames, String sql, SqlType sqlType, String table, long ts, String type) {
        this.data = data;
        this.database = database;
        this.es = es;
        this.id = id;
        this.isDdl = isDdl;
        this.mysqlType = mysqlType;
        this.old = old;
        this.pkNames = pkNames;
        this.sql = sql;
        this.sqlType = sqlType;
        this.table = table;
        this.ts = ts;
        this.type = type;
    }

    public boolean getIsDdl() {
        return isDdl;
    }

    public void setDdl(boolean ddl) {
        isDdl = ddl;
    }
}
